<ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        template="template.xhtml">
    <ui:define name="content">
        <div class="content ui-widget ui-widget-content ui-corner-all">
            <h2><h:outputText value="#{productBean.title}" /></h2>
            <h:form>
                <h:panelGroup rendered="#{not empty productBean.product}">
                    <p:commandButton value="Delete Product" action="#{productBean.delete}" ajax="false" />
                    <br /><br />
                </h:panelGroup>
                <h:panelGrid columns="2">
                    <h:outputLabel for="code" value="Code:" />
                    <p:inputText id="code" value="#{productBean.code}" maxlength="4" style="width: 50px" />
                    <h:outputLabel for="name" value="Name:" />
                    <p:inputText id="name" value="#{productBean.name}" maxlength="30" style="width: 200px" />
                    <h:outputLabel for="description" value="Description:" />
                    <p:inputTextarea id="description" value="#{productBean.description}" autoResize="false" styleClass="textarea" />
                    &#160;
                    <h:panelGroup>
                        <br />
                        <p:commandButton value="Save" action="#{productBean.save}" ajax="false" />
                        &#160;
                        <p:commandLink value="Cancel" action="#{productBean.cancel}" ajax="false" />
                    </h:panelGroup>
                </h:panelGrid>
            </h:form>
        </div>
    </ui:define>
</ui:composition>
